package com.white.shm.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONObject;
import com.white.shm.dao.AdminDao;
import com.white.shm.entity.Admin;
import com.white.shm.service.AdminService;

/**
 * @author White
 * @version 1.0
 * @since 2019/12/13 00:36
 */
@Service(value = "adminService")
public class AdminServiceImpl implements AdminService {

    @Autowired
    AdminDao adminDao;

    /**
     * Save.
     * @param admin the admin
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void save(Admin admin) {
        admin = adminDao.save(admin);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Admin login(JSONObject param) {

        //String name = param.getString("name");
        //String pwd = param.getString("password");
        //
        //Admin admin =
        //
        //List<Admin> list = baseDao.findAll(Admin.class);
        return null;
    }

}
